package day8.am;

public class TestArrayCopy4 {
    public static void main(String[] args) {
        int[] data = {12, 23, 12, 23, 23};
        int[] temp = new int[data.length + 1];
        // 将老数组中的元素复制到新数组中
        System.arraycopy(data, 0, temp, 0, data.length);
        temp[5] = 82;
        data[0] = 44;
        System.out.println(temp[0]);
        for(int x: temp){
            System.out.println(x);
        }
    }
}
